<?
	include('top.php');
	include('conn.php');
	session_start();
	$msg='';
	if($_REQUEST['up']=='true' and isset($_REQUEST['name']))
	{
		$name=$_REQUEST['name'];
		$sqledit="select * from businessmast where status=0 and bdesc='".$name."'";
		$resedit=mysql_query($sqledit);
		$rowedit=mysql_fetch_assoc($resedit);		
	}
	if($_REQUEST['submit']=='Update')
	{
		$bdesc=$_REQUEST['bdesc'];
		$enteredby=$_SESSION['username'];
		$bid=$_REQUEST['bid'];
		$sql="update businessmast set bdesc='".strtoupper($bdesc)."' where bid= $bid";
		$res=mysql_query($sql);
		if($res)
		{
			 echo "<script>window.location.href = 'businessmaster.php'</script>";
		}	
		else
		{
			$msg='';			
		}
	}	
?>
<div  align="center">
			<div ng-controller="SearchCtrl">
			<form name="businessedit" action="businessedit.php" method="post">
			<input type="hidden" name="bid" id="bid" value="<?=$rowedit['bid']?>" />
			<table  cellpadding="4" id="box-table-a" cellspacing="4" border="1" width="650" bgcolor="#000000" style="background-color:#DFEBF9;">
				<tr><td colspan="3" align="center" style="text-align:center; color:#FF0000;"><?=$msg?></td></tr>
				<tr>
				  <td colspan="3" align="center" style="text-align:center; font-weight:bold;">Business Master (Edit)</td>
				</tr>
				<tr bgcolor="#FFFFFF">
					<td ><label style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">Business Name</label></td>
					<td ><label style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">:</label></td>
					<td style="text-align:left; font-size:14px; color:#333333; font-weight:bold; vertical-align:middle;">
						<input type="text" id="bdesc" name="bdesc" class="smallInput" required= "" value="<?=$rowedit['bdesc']?>" ng-model="bdesc" style="width:280px; text-align:left; font-size:12px; font-weight:bold;" />
					</td>
				</tr>
				<tr>
					<td align="center" colspan="3" style="background-color:#BBE2EE">
					<button type="submit" class="btn" name="submit" value="Update">Update</button>
					</td>
				</tr>
			</table>
			</form>
		</div>
			
</div>
</body>
</html>
